package mainTest;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

import com.lab.pojo.User;
import com.lab.pojo.UserDAO;

public class Main {
	public static void main(String[] args) {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("applicationContext.xml");
		UserDAO userDao = UserDAO.getFromApplicationContext(ctx);
		User user = userDao.findById(2);
		System.out.println(user.getUserName());
		
		User user2 = new User();
		user2.setUserName("bigone");
		userDao.save(user2);
	}
}
